#ifndef ADDOPERATIONWIDGET_H
#define ADDOPERATIONWIDGET_H

#include <QWidget>
#include <QPushButton>
#include <QIcon>
#include <QLabel>
#include <QEvent>
#include <QVBoxLayout>


/* ------------------------------- 快捷窗口 ------------------------------- */
class AddOperationWidget : public QWidget
{
    Q_OBJECT
public:
    explicit AddOperationWidget(QWidget *parent = nullptr);

protected:
    void createBtn(const QIcon& avatar, const QString & text);
    void paintEvent(QPaintEvent *event) override;

private:
    QVBoxLayout* layout;
};


/* ------------------------------- 快捷按钮元素 ------------------------------- */
class CustomToolButton : public QWidget
{
    Q_OBJECT

public:
    explicit CustomToolButton(const QIcon &icon, const QString &text);
    QString text() const;

signals:
    void clicked(); // 模拟 QPushButton 的 clicked 信号

protected:
    void mousePressEvent(QMouseEvent *event) override;
    void enterEvent(QEnterEvent *event) override; // 用于悬停效果
    void leaveEvent(QEvent *event) override;   // 用于悬停效果
    void paintEvent(QPaintEvent *event) override; // 用于绘制背景和圆角

private:
    QHBoxLayout *layout;
    bool isHovered = false; // 悬停状态
    QString curText;
};



#endif // ADDOPERATIONWIDGET_H
